import random


class Human:
    def __init__(self, name, money):
        self.name = name
        self.money = money

    def show(self):
        print(f"我是{self.name},现有{self.money}块钱")


class Manager(Human):
    # 发红包
    def sendmoney(self, money, num):
        # 定义一个空列表
        lklist = []
        if self.money < money:
            print("逗呢？！")
            return None
        avrg = money // num
        rest = money % num
        for i in range(num):
            lklist.append(avrg)
        lklist[-1] += rest

        self.money -= money
        return lklist


class Member(Human):

    def grepmoney(self, lk: list):

        if not lk:
            print("逗呢？")
            return None
        ranindex=random.randint(0,len(lk)-1)
        self.money+=lk.pop(ranindex)
        print(self.money)

if __name__ == '__main__':
    # a=Human("hh",10000)
    b= Manager("lili",10000)
    lks=b.sendmoney(0,6)
    # print(len(lks),lks)
    b.show()
    c=Member("gigi",0)
    c.grepmoney(lks)
    # print(len(lks),lks)
    c.show()
    d=Member("kiki",0)
    d.grepmoney(lks)
    # print(len(lks),lks)
    d.show()


